package com.wcll.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wcll.www.DeleteJSAvatarBean;

public class DeleteJSAvatarServlet extends HttpServlet {

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		DeleteJSAvatarBean bjsab = new DeleteJSAvatarBean();
		request.setCharacterEncoding("UTF-8");
		if(request.getParameter("deleid")!=null){
			int id = Integer.parseInt(request.getParameter("deleid"));
			boolean bl = bjsab.deleteJobSort(id);
			if(bl){
				this.getServletContext().getRequestDispatcher("/messages.jsp?msg=succeed").forward(request,response);
			}
			else{
				this.getServletContext().getRequestDispatcher("/messages.jsp?msg=failed").forward(request,response);
			}
		}
	}	

}
